treepath: Use g_renew()
authorBenjamin Otte <otte@redhat.com>
Fri, 6 Mar 2020 03:31:30 +0000 (04:31 +0100)
committerBenjamin Otte <otte@redhat.com>
Fri, 6 Mar 2020 04:43:56 +0000 (05:43 +0100)
gtk/gtktreemodel.c

index 226791ab5aac71f4f7a4b27bb2f4fc438045ca98..6a3467474944ed30ec03bcc38bd29d09f4fbedfb 100644 (file)
@@ -802,12 +802,8 @@ gtk_tree_path_append_index (GtkTreePath *path,
 
   if (path->depth == path->alloc)
     {
-      gint *indices;
       path->alloc = MAX (path->alloc * 2, 1);
-      indices = g_new (gint, path->alloc);
-      memcpy (indices, path->indices, path->depth * sizeof (gint));
-      g_free (path->indices);
-      path->indices = indices;
+      path->indices = g_renew (gint, path->indices, path->alloc);
     }
 
   path->depth += 1;